package com.aigou.admin.service.impl;

import com.aigou.admin.dao.ProductDAO;
import com.aigou.admin.dao.impl.ProductDAOImpl;
import com.aigou.admin.entity.Product;
import com.aigou.admin.service.ProductService;

import java.util.List;

public class ProductServiceImpl implements ProductService {

    private final ProductDAO productDao = new ProductDAOImpl();

    @Override
    public List<Product> getAllProducts() {
        return productDao.getAllProducts();
    }

    @Override
    public Product getProductById(String id) {
        return productDao.getProductById(id);
    }

    @Override
    public int addProduct(Product product) {
        return productDao.addProduct(product);
    }

    @Override
    public int updateProduct(Product product) {
        return productDao.updateProduct(product);
    }

    @Override
    public int deleteProduct(String id) {
        return productDao.deleteProduct(id);
    }
}

